<script setup>
const data = [
    { id: 1, pId: 0, name: '节点1' },
    { id: 2, pId: 1, name: '节点1-1' },
    { id: 3, pId: 1, name: '节点1-2' },
    { id: 4, pId: 2, name: '节点1-1-1' },
    { id: 5, pId: 0, name: '节点2' },
    { id: 6, pId: 5, name: '节点2-1' },
];
// console.log(data.toTree("id", "pId", "children"));
const tree = data.toTree()
console.log(tree.treeFind(item => item.id === 40));
</script>

<template>
    <el-config-provider :empty-values="['', null, undefined]">
        <router-view></router-view>
    </el-config-provider>
</template>

<style lang="scss">
@use "./style.scss";
</style>
